home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-04 | 2.2 KB | 90 lines | [TEXT/KAHL] |
- /***************************************************** IMPLEMENTATION
- DATE: 9/20/93
- AUTHOR: Eric R. Rosé
-
- CLASS: CPPYentaMenuBar
-
- SUPERCLASS: CPPMenuBar
-
- This C++ class manages the menu bar for our application
-
- ********************************************************************/
-
- #pragma once
-
- #include "CPPYentaMenuBar.h"
- #include <CPPWindowManager.h>
- #include <CPPTEWindow.h>
- #include "MyCommands.h"
- #include "Commands.h"
-
- extern Boolean gQuitApp;
- extern CPPWindowManager *gWindowManager;
-
- /*-----------------------------------------------------------------*/
-
- #define kAppleMenu 1028
- #define kAbout 1
-
- #define kFileMenu 1029
- #define kPrefs 1
- #define kAutoReply 2
- #define kQuit 4
-
- #define kEditMenu 1030
- #define kCut 1
- #define kCopy 2
- #define kPaste 3
- #define kClear 4
- #define kSelectAll 6
-
- #define kWindowMenu 1031
- #define kSend 1
- #define kMessage 2
- #define kClose 4
-
- /*-----------------------------------------------------------------*/
- /*------------------------ PUBLIC METHODS -------------------------*/
- /*-----------------------------------------------------------------*/
-
- CPPYentaMenuBar::CPPYentaMenuBar (void) : CPPMenuBar (128, kAppleMenu)
- /* create a menu bar based on the passed-in resource template */
- {
- AddDAs (kAppleMenu);
- SetCommandBindings();
- }
-
- /*-----------------------------------------------------------------*/
-
- CPPYentaMenuBar::~CPPYentaMenuBar (void)
- {
- }
-
- /*-----------------------------------------------------------------*/
-
- char *CPPYentaMenuBar::ClassName (void)
- {
- return "CPPYentaMenuBar";
- }
-
- /*-----------------------------------------------------------------*/
-
- void CPPYentaMenuBar::SetCommandBindings (void)
- {
- BindCommand(kAppleMenu, kAbout, kCmdAbout);
-
- BindCommand(kFileMenu, kPrefs, kCmdPrefs);
- BindCommand(kFileMenu, kAutoReply, kCmdAutoReply);
- BindCommand(kFileMenu, kQuit, kCmdQuit);
-
- BindCommand(kEditMenu, kCut, kCmdCut);
- BindCommand(kEditMenu, kCopy, kCmdCopy);
- BindCommand(kEditMenu, kPaste, kCmdPaste);
- BindCommand(kEditMenu, kClear, kCmdClear);
- BindCommand(kEditMenu, kSelectAll, kCmdSelectAll);
-
- BindCommand(kWindowMenu, kSend, kCmdSend);
- BindCommand(kWindowMenu, kMessage, kCmdMessage);
- BindCommand(kWindowMenu, kClose, kCmdClose);
- }
-